﻿using System;
using UnityEngine;

// Token: 0x02000024 RID: 36
[RequireComponent(typeof(Camera))]
[ExecuteInEditMode]
[AddComponentMenu("Image Effects/FXAA")]
public class FXAA : FXAAPostEffectsBase
{
	// Token: 0x060000C3 RID: 195 RVA: 0x0000B645 File Offset: 0x00009845
	private void CreateMaterials()
	{
		if (this.mat == null)
		{
			this.mat = base.CheckShaderAndCreateMaterial(this.shader, this.mat);
		}
	}

	// Token: 0x060000C4 RID: 196 RVA: 0x0000B670 File Offset: 0x00009870
	private void Start()
	{
		this.shader = Shader.Find("Hidden/FXAA3");
		this.CreateMaterials();
		base.CheckSupport(false);
	}

	// Token: 0x060000C5 RID: 197 RVA: 0x0000B690 File Offset: 0x00009890
	public void OnRenderImage(RenderTexture source, RenderTexture destination)
	{
		this.CreateMaterials();
		float num = 1f / (float)Screen.width;
		float num2 = 1f / (float)Screen.height;
		this.mat.SetVector("_rcpFrame", new Vector4(num, num2, 0f, 0f));
		this.mat.SetVector("_rcpFrameOpt", new Vector4(num * 2f, num2 * 2f, num * 0.5f, num2 * 0.5f));
		Graphics.Blit(source, destination, this.mat);
	}

	// Token: 0x040001D3 RID: 467
	public Shader shader;

	// Token: 0x040001D4 RID: 468
	private Material mat;
}
